package com.sjgs.gis.service.dto;

import java.io.Serializable;
import java.util.Objects;

import com.sjgs.gis.web.rest.WarResource;
import io.github.jhipster.service.Criteria;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;

/**
 * Criteria class for the {@link com.sjgs.gis.domain.War} entity. This class is used
 * in {@link WarResource} to receive all the possible filtering options from
 * the Http GET request parameters.
 * For example the following could be a valid request:
 * {@code /wars?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
 * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
 * fix type specific filters.
 */
public class WarCriteria implements Serializable, Criteria {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private StringFilter name;

    private StringFilter version;

    private StringFilter srcUrl;

    private StringFilter fkey;

    public WarCriteria() {
    }

    public WarCriteria(WarCriteria other) {
        this.id = other.id == null ? null : other.id.copy();
        this.name = other.name == null ? null : other.name.copy();
        this.version = other.version == null ? null : other.version.copy();
        this.srcUrl = other.srcUrl == null ? null : other.srcUrl.copy();
        this.fkey = other.fkey == null ? null : other.fkey.copy();
    }

    @Override
    public WarCriteria copy() {
        return new WarCriteria(this);
    }

    public LongFilter getId() {
        return id;
    }

    public void setId(LongFilter id) {
        this.id = id;
    }

    public StringFilter getName() {
        return name;
    }

    public void setName(StringFilter name) {
        this.name = name;
    }

    public StringFilter getVersion() {
        return version;
    }

    public void setVersion(StringFilter version) {
        this.version = version;
    }

    public StringFilter getSrcUrl() {
        return srcUrl;
    }

    public void setSrcUrl(StringFilter srcUrl) {
        this.srcUrl = srcUrl;
    }

    public StringFilter getFkey() {
        return fkey;
    }

    public void setFkey(StringFilter fkey) {
        this.fkey = fkey;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final WarCriteria that = (WarCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(name, that.name) &&
            Objects.equals(version, that.version) &&
            Objects.equals(srcUrl, that.srcUrl) &&
            Objects.equals(fkey, that.fkey);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        name,
        version,
        srcUrl,
        fkey
        );
    }

    // prettier-ignore
    @Override
    public String toString() {
        return "WarCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (name != null ? "name=" + name + ", " : "") +
                (version != null ? "version=" + version + ", " : "") +
                (srcUrl != null ? "srcUrl=" + srcUrl + ", " : "") +
                (fkey != null ? "fkey=" + fkey + ", " : "") +
            "}";
    }

}
